Event

interface Event

Represents a discrete occurrence or action within the application that is tracked for analytics, logging, or operational purposes.

An Event typically has a name, an associated session, and a set of key-value properties providing further context about the occurrence. For example, an event could signify content playback, user interaction, system status changes, or errors.

Instances of this interface are usually created by an event tracking service or module within the application when a trackable action happens. They are then often queued and processed for transmission to a backend analytics platform.

Session Management Note: The static newSession methods defined in this interface are placeholders and currently throw NotImplementedException. Actual session management (creating new sessions and associating events with them) is expected to be handled by a concrete implementation or a dedicated event management service that utilizes this Event interface. Refer to the documentation of the specific event tracking implementation for details on session handling.

Functions

Link copied to clipboard
abstract fun getName(): String
Gets the descriptive name of this event.
Link copied to clipboard
abstract fun getProperties(): Map<String, Any>
Gets the custom properties associated with this event, providing additional contextual information.
Link copied to clipboard
abstract fun getSessionId(): String
Gets the session identifier associated with this event.
Link copied to clipboard
open fun newSession(): String
Placeholder: Intended to signal the start of a new event session and generate a new session ID.
open fun newSession(id: String)
Placeholder: Intended to start a new event session with a user-provided session ID.